{template header.html}
<form action="" method="post" name="myform" id="myform">
<div class="subnav">
	<div class="content-menu ib-a blue line-x">
		{$menu}
	</div>
	<div class="bk10"></div>
	<div class="table-list col-tab">
		<ul class="tabBut cu-li">
			<li class="on">{lang('325')}</li>
		</ul>
		<div class="contentList pad-10">
				<table width="100%" class="table_form">
				<tr>
                    <th width="200">{lang('html-028')}： </th>
                    <td>
                    <input name="is_all" type="radio" value="0" onclick="dr_set_type(0)" checked="checked" />&nbsp;<label>{lang('html-651')}</label>&nbsp;&nbsp;&nbsp;&nbsp;
                    <input name="is_all" type="radio" value="1" onclick="dr_set_type(1)" />&nbsp;<label>{lang('html-652')}</label>&nbsp;&nbsp;&nbsp;&nbsp;
                    <input name="is_all" type="radio" value="2" onclick="dr_set_type(2)" />&nbsp;<label>{lang('html-708')}</label>
                    </td>
                </tr>
				<tr class="dr_0">
                    <th>{lang('m-244')}： </th>
                    <td>
                    <input class="input-text" type="text" name="data[mail]" style="width:250px;" />
                    </td>
                </tr>
                <tr class="dr_1" style="display:none">
                    <th>{lang('m-244')}： </th>
                    <td>
                    <textarea class="input-text" name="data[mails]" style="height:200px; width:250px;"></textarea>
                    <br><font color="#999999">多个{lang('m-244')}按“回车符号”分隔，一行一个{lang('m-244')}</font>
                    </td>
                </tr>
                <tr class="dr_2" style="display:none">
                    <th>{lang('html-348')}： </th>
                    <td>
                        <select name="data[groupid]">
                            <option value=""> {lang('151')} </option>
                            {list action=cache name=MEMBER.group}
                            <option value="{$t.id}"> {$t.name} </option>
                            {/list}
                        </select>
                    </td>
                </tr>
                <tr>
                    <th>{lang('html-375')}： </th>
                    <td>
                    <input class="input-text" type="text" name="data[title]" style="width:450px;" />
                    </td>
                </tr>
                <tr>
                    <th>{lang('html-654')}： </th>
                    <td>
                    {dr_field_input('message', 'Ueditor', array('option' => array( 'mode' => 1, 'height' => 300)), '')}
                    </td>
                </tr>
                <tr class="dr_botton">
                    <th style="border:none;">&nbsp;</th>
                    <td style="border:none;">
                    <input class="button" type="button" name="button" value="{lang('html-655')}" onclick="dr_send()" />
                    <span id="dr_send_note"></span>
                    </td>
                </tr>
                <tr class="dr_submit" style="display: none">
                    <th style="border:none;">&nbsp;</th>
                    <td style="border:none;">
                        <input class="button" type="submit" name="button" value="{lang('html-655')}" />
                    </td>
                </tr>
				</table>
            </div>
		</div>
	</div>
</div>
</form>
<script type="text/javascript">
<!--
function dr_send() {
    var data = $("#myform").serialize();
	$("#dr_send_note").html('<img src="{SITE_URL}dayrui/statics/images/loading.gif">');
	$("#dr_message").val(editor.getContent());
	$.ajax({type: "POST",dataType:"json", url: "{dr_url('mail/ajaxsend')}&"+Math.random(), data: data,
		success: function(data) {
			if (data.status == 1) {
				$("#dr_send_note").html('<font color=green>'+data.code+'</font>');
			} else {
				$("#dr_send_note").html('<font color=red>'+data.code+'</font>');
			}
		},
		error: function(HttpRequest, ajaxOptions, thrownError) {
			$("#dr_send_note").html('');
			alert(thrownError + "\r\n" + HttpRequest.statusText + "\r\n" + HttpRequest.responseText);
		}
	});
	return false;
}
function dr_set_type(i) {
    $('.dr_0').hide();
    $('.dr_1').hide();
    $('.dr_2').hide();
    $('.dr_'+i).show();
    if (i == '2') {
        $('.dr_botton').hide();
        $('.dr_submit').show();
        $('#myform').attr('action', '{dr_url('mail/ajaxsend')}');
    } else {
        $('.dr_botton').show();
        $('.dr_submit').hide();
        $('#myform').attr('action', '');
    }
}
//-->
</script>
{template footer.html}